package com.wanmait.demo.service.impl;

import com.github.pagehelper.PageInfo;
import com.wanmait.demo.mapper.CommunityMapper;
import com.wanmait.demo.pojo.Community;
import com.wanmait.demo.service.CommunityService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class CommunityServiceimpl implements CommunityService {
    //zjj
    @Override
    public List<Community> findAllCommunityByTownId(Integer id) {

        List<Community> communityList= null;
        try {
            communityList = communityMapper.getCommunitysByTownId(id);
        } catch (Exception e) {
            e.printStackTrace();
        }

        return communityList;
    }





    @Resource
    private CommunityMapper communityMapper;
    @Override
    public void insert(Community object) {

    }

    @Override
    public void delete(Integer id) {

    }

    @Override
    public void delete(String ids) {

    }

    @Override
    public void update(Community object) {

    }

    @Override
    public Community findById(Integer id) {
        return null;
    }

    @Override
    public List<Community> findAll() {
        return null;
    }

    @Override
    public PageInfo<Community> findPage(int pageNum, int pageSize) {
        return null;
    }

    @Override
    public List<Community> selectallcommunity(int townid) {
        return communityMapper.selectallcomunity(townid);
    }
}
